
rem
bbdoc: Hit box component. Used by quadtree and collision system.
about: Using False in the Create() function will exclude the entity from collision
not from the qudtree which is mandatory.
endrem
Type THitBoxComponent Extends TComponent

	Field _dimension:TVector2D
	
	'if set to false, then entity with this component will not be checked for collision
	Field _collision:Int
	

	Method New()
		_dimension = New TVector2D
		_collision = True
	End Method

	
	Function Create:THitBoxComponent(w:Float, h:Float, collision:Int = True)
		Local c:THitBoxComponent = New THitBoxComponent
		c.Set(w, h)
		c._collision = collision
		Return c
	End Function


	Method Set(w:Int, h:Int)
		_dimension.Set(w, h)
	End Method
	
	
	Method Get:TVector2D()
		Return _dimension
	End Method
	
	
	Method GetWidth:Float()
		Return _dimension.GetX()
	End Method
	

	Method GetHeight:Float()
		Return _dimension.GetY()
	End Method
End Type
